import request from "../utils/request";

//登录
export const getLoginApi = (body) => {
  return request("/login", {
    method: "post",
    body,
  });
};
//获取用户数据
export const getUserDataApi = (query) => {
  return request(`/user`, {
    query:{
      pageNum:"1",
      pageSize: "10",
      ...query
    }
  });
};
//添加用户
export const addUserApi = (body) => {
  console.log("添加用户body", body);
  return request(`/user`, {
    method: "post",
    body: {
      username:body.username,
      email:body.email, 
      mobile:body.mobile, 
      password:body.password, 
      roleId:body.roleId, 
      ssex:body.ssex, 
      deptId:body.deptId, 
      status:body.status, 
      
    },
  });
};

//删除选中用户
export const delUserInfoApi = (id) => {
  return request(`/user/`+id,{
    method:"delete",
  });
};


//获取部门数据
export const getDeptDataApi = (body) => {
  return request(`/dept`);
};
